<template>
  <div id="app">
    <ul>
      <li v-for="(item, index) in arr" :key="index">{{item}}</li>
    </ul>
    <button @click="btn">走一走</button>
  </div>
</template>

<script>
// 点击按钮, 改变3个li的顺序, 在头上的就到末尾.
export default {
  name: 'App',
  data () {
    return {
      arr: ['帅哥', '美女', '程序猿']
    }
  },
  methods: {
    btn () {
      const first = this.arr.shift()
      this.arr.push(first)
    }
  }
}
</script>

<style>

</style>
